#ifndef __DNA_RFCRYPTO_H__
#define __DNA_RFCRYPTO_H__

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif  /* __cplusplus */
#endif  /* __cplusplus */

int dna_rfrc4(const unsigned char *input, unsigned char *output, unsigned int len, const unsigned char key[16]);

int dna_rfaesenc(unsigned char *input, unsigned int len,
        unsigned char *output, unsigned int maxsize, const unsigned char key[16]);

int dna_rfaesdec(unsigned char *input, unsigned int len,
        unsigned char *output, unsigned int maxsize, const unsigned char key[16]);

/**
 *  Hamming encode interface.
 *
 *  @input[in]:         Source data
 *  @len[in]:           Source data valid length
 *  @output[out]:       Hamming code data
 *  @maxsize[in]:       Hamming code data buffer size
 *
 *  Return actual hamming code data length. -DNA_FAIL means fail
 */
int dna_rfhamenc(const unsigned char *input, unsigned int len, unsigned char *output, unsigned int maxsize);

/**
 *  Hamming decode interface.
 *
 *  @input[in]:         Hamming code data
 *  @len[in]:           Hamming code data valid length
 *  @output[out]:       Source data
 *  @maxsize[out]:      Source data buffer size
 *
 *  Return actual source data length. -DNA_FAIL means fail.
 */
int dna_rfhamdec(const unsigned char *input, unsigned int len, unsigned char *output, unsigned int maxsize);

#ifdef __cplusplus
#if __cplusplus
}
#endif  /* __cplusplus */
#endif  /* __cplusplus */

#endif  /* __DNA_RFCRYPTO_H__ */
